package org.dromara.timemate.mapper;

import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.timemate.domain.DeviceInfo;
import org.dromara.timemate.domain.vo.DataAcquisitionVo;
import org.dromara.timemate.domain.vo.DataIndexVo;
import org.dromara.timemate.domain.vo.DeviceManageVo;

import java.util.Date;
import java.util.List;


public interface DeviceInfoMapper  extends BaseMapperPlus<DeviceInfo, DeviceManageVo> {
    /**
     * 通过手机号、设备类型，进行分页
     * @param phonenumber
     * @param deviceType
     * @param start
     * @param pageSize
     * @return
     */
    List<DeviceManageVo> ByPhoneDTypePageQuery(@Param("phonenumber") String phonenumber, @Param("deviceType") String deviceType, @Param("start") Integer start, @Param("pageSize") Integer pageSize);

    /**
     *通过手机号、设备类型为条件,查询数据得数量
     * @param phonenumber
     * @param deviceType
     * @return
     */
    int ByPhoneDTypeSelectCount(@Param("phonenumber") String phonenumber, @Param("deviceType") String deviceType);
    /**
     * 多条件分页查询
     * @param phonenumber
     * @param deviceType
     * @param deviceName
     * @param recordDay
     * @param start
     * @param pageSize
     * @return
     */
    List<DataAcquisitionVo> selectByParamsPageQuery(@Param("phonenumber") String phonenumber, @Param("deviceType") String deviceType, @Param("deviceName") String deviceName, @Param("recordDay") Date recordDay,@Param("start") Integer start, @Param("pageSize") Integer pageSize);

    /**
     * 多条件，查询出数据得数量
     * @param phonenumber
     * @param deviceType
     * @param deviceName
     * @param recordDay
     * @return
     */
    int selectByParamsCount(@Param("phonenumber") String phonenumber, @Param("deviceType") String deviceType, @Param("deviceName") String deviceName, @Param("recordDay") Date recordDay);

    /**
     * 如使用导出功能，条件查询
     * @param phonenumber
     * @param deviceType
     * @return
     */
    List<DeviceManageVo> queryList(@Param("phonenumber") String phonenumber, @Param("deviceType") String deviceType);

    /**
     * 通过设备名称、设备类型查询、穿戴者id
     *
     * @param deviceName
     * @param deviceType
     * @param wearerId
     * @param pageSize
     * @return
     */
    List<DataIndexVo> queryDataIndexList(@Param("deviceType") String deviceType,@Param("userId") Long userId,@Param("wearerId") Long wearerId, @Param("deviceName") String deviceName,@Param("recordDay") Date recordDay, @Param("start") Integer start,  @Param("pageSize") Integer pageSize);

    /**
     * 多条件，查询出数据得数量
     * @param deviceType
     * @param deviceName
     * @param recordDay
     * @return
     */
    int selectDataIndexCount(@Param("deviceType") String deviceType,@Param("userId") Long userId,@Param("wearerId") Long wearerId,@Param("deviceName") String deviceName, @Param("recordDay") Date recordDay);


    List<DeviceManageVo> queryAllDeviceInfo();

}
